package com.farmcode.console.api.model;

import com.farmcode.base.web.RowSelectedSpc;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import java.util.List;

@Entity
@Table(name="FC_TEMPLATE")
public class Template extends RowSelectedSpc implements Serializable {
	//Fields
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID", unique=true, nullable=false, precision=18, scale=0)
	private Long id;
	@ManyToOne
	@JoinColumn(name="PACKAGE_ID", nullable=false)
	private PackageTemplate packageTemplate;
	@Column(name="NAME", unique=true, nullable=false, precision=20, scale=0)
	private String name;
	@Column(name="PATH", unique=true, nullable=false, precision=200, scale=0)
	private String path;
	@Column(name="EXTENSION", unique=true, nullable=false, precision=8, scale=0)
	private String extension;
	@Column(name="ACTIVE", unique=true, nullable=false, precision=1, scale=0)
	private String active;
	@OneToMany(mappedBy="template")
	private List<Match> matchCollection;
	
	//Default Constructor
	public Template() {}
	//Constructor, Parameters
	public Template(Long id, String name, String path, String extension, String active){
		this.id = id;
		this.name = name;
		this.path = path;
		this.extension = extension;
		this.active = active;
	}
	//Getters and Setters
	public void setId(Long id){
		this.id = id;
	}
	public Long getId(){
		return this.id;
	}
	public void setPackageTemplate(PackageTemplate packageTemplate){
		this.packageTemplate = packageTemplate;
	}
	public PackageTemplate getPackageTemplate(){
		return this.packageTemplate;
	}
	public void setName(String name){
		this.name = name;
	}
	public String getName(){
		return this.name;
	}
	public void setPath(String path){
		this.path = path;
	}
	public String getPath(){
		return this.path;
	}
	public void setExtension(String extension){
		this.extension = extension;
	}
	public String getExtension(){
		return this.extension;
	}
	public void setActive(String active){
		this.active = active;
	}
	public String getActive(){
		return this.active;
	}
	public List<Match> getMatchCollection(){
		return this.matchCollection;
	}
	public void setMatchCollection(List<Match> matchCollection){
		this.matchCollection = matchCollection;
	}
	@Override
	public String toString(){
		return super.toString();
	}
	
	
}
